package scauCmiScaffolding.compiled;

import org.eclipse.jet.JET2Context;
import org.eclipse.jet.JET2Template;
import org.eclipse.jet.JET2Writer;
import org.eclipse.jet.taglib.RuntimeTagElement;
import org.eclipse.jet.taglib.TagInfo;

public class _jet_cmiPagination_4 implements JET2Template {
    private static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$

    public _jet_cmiPagination_4() {
        super();
    }

    private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
    
    private static final TagInfo _td_c_get_1_9 = new TagInfo("c:get", //$NON-NLS-1$
            1, 9,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$packageName", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_get_16_8 = new TagInfo("c:get", //$NON-NLS-1$
            16, 8,
            new String[] {
                "select", //$NON-NLS-1$
            },
            new String[] {
                "$packageName", //$NON-NLS-1$
            } );

    public void generate(final JET2Context context, final JET2Writer __out) {
        JET2Writer out = __out;
        out.write("package ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_1_9 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_1_9); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_1_9.setRuntimeParent(null);
        _jettag_c_get_1_9.setTagInfo(_td_c_get_1_9);
        _jettag_c_get_1_9.doStart(context, out);
        _jettag_c_get_1_9.doEnd();
        out.write(".base.bean;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write(NL);         
        out.write("import java.io.Serializable;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.lang.reflect.Field;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.util.ArrayList;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.util.Collection;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.util.HashMap;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.util.HashSet;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.util.List;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.util.Map;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("import java.util.Set;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("import com.google.gson.Gson;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("import ");  //$NON-NLS-1$        
        RuntimeTagElement _jettag_c_get_16_8 = context.getTagFactory().createRuntimeTag(_jetns_c, "get", "c:get", _td_c_get_16_8); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_c_get_16_8.setRuntimeParent(null);
        _jettag_c_get_16_8.setTagInfo(_td_c_get_16_8);
        _jettag_c_get_16_8.doStart(context, out);
        _jettag_c_get_16_8.doEnd();
        out.write(".util.CmiHibernateProxyUtil;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//用于JSP后台的分页，与CmiPagination类的区别之处是：");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//CmiPagination是用于CmiPsonService类中。用于android\\weixin等客户端使用的分页类");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//本类用于jsp页面分页，数据格式是实体对象");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("public class CmiPagination implements Serializable {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("\tpublic static final long serialVersionUID = 1L;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic static final int BEGIN_PAGE_SIZE = 10; // 起始的每页记录数目");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate static final int MAX_CURSOR_NUMBER = 10; // 页面游标最大显示的数目");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("\tprivate int paginationSize = BEGIN_PAGE_SIZE; // 每页记录条数");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int beginPagination = 1; // 起始页");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int currentPagination = beginPagination; // 当前页");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int totalPaginations; // 总页数目");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int totalRecords; // 所有记录数目");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t// TODO　请杨宏宇确认　２０２０年２月７");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t//\t用于JSP后台页面数据列表\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int searchBeginCursor; // 搜索起始的游标");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int searchEndCursor; // 搜索终止的游标");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int hiddenCurrentPagination = currentPagination; // 隐藏域用于jsp的页面传参，在绑定器中使用");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int hiddenTotalPaginations = totalPaginations; // 隐藏域用于jsp的页面传参，在绑定器中使用");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate String inputCurrentPagination = \"\"; // 选择页码按钮的控件变量");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int queryBoxNumber = 1; // 组合条件查询的条件控件框数量");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate Set<Integer> eventIds = new HashSet<Integer>();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate int foodtypeId;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t// 组合条件查询中选中的条件列表");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate List<String> selectedCompositeConditions = new ArrayList<String>(); ");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t// 组合条件查询中用户输入的条件集合");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate List<String> inputCompositeConditions = new ArrayList<String>(); ");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t// 食物类型的id和名称");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate Map<Integer,String> foodTypeIdMap = new HashMap<Integer,String>();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t// TODO　请杨宏宇确认　０２０年２月７");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t//\t用于json数据的分页，例如微信端等，暂时不确定");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tprivate String name;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tMap<String, CmiAttributePagination> attributeMap;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic Map<String, CmiAttributePagination> getAttributeMap() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn attributeMap;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("\tpublic void setAttributeMap(Map<String, CmiAttributePagination> attributeMap) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.attributeMap = attributeMap;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("\tpublic CmiPagination() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis(10, 1, 1, 1, 0);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//\t\tfoodTypeIdMap.put(1642, \"农产品\");");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//\t\tfoodTypeIdMap.put(565, \"肉制品\");");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//\t\tfoodTypeIdMap.put(583, \"水产品\");");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//\t\tfoodTypeIdMap.put(566, \"乳制品\");");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//\t\tfoodTypeIdMap.put(562, \"粮油品\");");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//\t\tfoodTypeIdMap.put(592, \"其他制品\");");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic CmiPagination(int totalElements) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.reset(totalElements);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    ");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    public CmiPagination(Object object) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//        默认初始化");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    \tthis(10, 1, 1, 1, 0);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//        设置其余的属性");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    \tthis.setPagination(object);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//    \tthis.hiddenTotalPaginations=object.");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        ");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        ");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("    public CmiPagination(int paginationSize, int beginPagination, int currentPagination, int totalPaginations, int totalRecords) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        super();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.paginationSize = paginationSize;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.beginPagination = beginPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.currentPagination = currentPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.totalPaginations = totalPaginations;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.totalRecords = totalRecords;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap = new HashMap<String, CmiAttributePagination>();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//        initAttribute();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("    public void setPagination(Object object) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        // TODO");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        if (object instanceof Collection<?>) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            int myTotalRecords = ((Collection<?>) object).size();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            this.setTotalRecords(myTotalRecords);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            int myTotalPages = 0;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            if (myTotalRecords % this.paginationSize == 0) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                myTotalPages = myTotalRecords / this.paginationSize;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            } else {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                myTotalPages = myTotalRecords / this.paginationSize + 1;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            this.setTotalPaginations(myTotalPages);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        } else {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            object = CmiHibernateProxyUtil.deproxy(object);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            Field[] fields = object.getClass().getDeclaredFields();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            Field.setAccessible(fields, true);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            for (Field field : fields) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                Object fieldObject;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                try {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    String fieldName = field.getName();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    fieldObject = field.get(object);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    if (!(fieldObject instanceof Collection<?>))");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                        continue;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    ");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    if (!this.attributeMap.containsKey(fieldName)) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t\t\t// 是集合就注册 CmiAttributePagination");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t\t\tthis.attributeMap.put(fieldName, new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t\t@SuppressWarnings(\"unchecked\")");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    Collection<Object> objCollection = (Collection<Object>) fieldObject;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("                    int myTotalRecords = objCollection.size();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("//                    System.out.println(\"---------\" + fieldName);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    CmiAttributePagination cmiAttributePagination = this.attributeMap.get(fieldName);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("                    cmiAttributePagination.setTotalRecords(myTotalRecords);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    int myTotalPages = 0;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    if (myTotalRecords % cmiAttributePagination.getPageSize() == 0) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                        myTotalPages = myTotalRecords / cmiAttributePagination.getPageSize();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    } else {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                        myTotalPages = myTotalRecords / cmiAttributePagination.getPageSize() + 1;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    cmiAttributePagination.setTotalPage(myTotalPages);");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                } catch (IllegalArgumentException | IllegalAccessException e) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    // TODO Auto-generated catch block");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                    e.printStackTrace();");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("                }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("            }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("    private void initAttribute() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"eventPunishs\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"motives\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"uris\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"adultertypes\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"records\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"eventQuantitytypes\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"eventAdulterlinks\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"eventQualitytypes\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("\t\tthis.attributeMap.put(\"events\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"additiveAddresses\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"foodSaleaddresses\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.attributeMap.put(\"producers\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"detectdepartments\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.attributeMap.put(\"suppliers\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"materialAddresses\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"addresses\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"recordetails\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"recordUris\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"reports\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"recordetailUris\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("        this.attributeMap.put(\"\", new CmiAttributePagination());");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("    }");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t// 分页类的重新设置页面属性，每次查询，page对象的一些属性都需要重置。");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void reset(int totalElements) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.totalRecords = totalElements;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tif (this.totalRecords == 0) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tthis.totalPaginations = 1;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t} else if (this.totalRecords % this.paginationSize == 0) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tthis.totalPaginations = this.totalRecords / this.paginationSize;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t} else {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tthis.totalPaginations = this.totalRecords / this.paginationSize + 1;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.inputCurrentPagination = \"\";");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tif(this.totalPaginations <=  this.MAX_CURSOR_NUMBER + 1) {   //左边的区间和右边的区间重叠");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tthis.searchBeginCursor = 1;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tthis.searchEndCursor = this.totalPaginations;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t}else {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\tif(this.totalPaginations - this.currentPagination  < this.MAX_CURSOR_NUMBER/2) {    //在右边的区间");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\tthis.searchBeginCursor  = this.totalPaginations - this.MAX_CURSOR_NUMBER;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\tthis.searchEndCursor = this.totalPaginations;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t}else if (this.currentPagination - 1 < this.MAX_CURSOR_NUMBER/2) {  //在左边的区间");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\tthis.searchBeginCursor = 1;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\tthis.searchEndCursor =  this.searchBeginCursor + this.MAX_CURSOR_NUMBER;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t}else {//在中间的区间");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\tthis.searchBeginCursor =  this.currentPagination - this.MAX_CURSOR_NUMBER/2;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\tthis.searchEndCursor = this.currentPagination + this.MAX_CURSOR_NUMBER/2;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//\t\t前端使用的是这连哥哥做分页控制，需要更新这两个变量。");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.hiddenTotalPaginations=totalPaginations;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.hiddenCurrentPagination=currentPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getBeginPagination() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn beginPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setBeginPagination(int beginPage) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.beginPagination = beginPage;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getCurrentPagination() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn currentPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setCurrentPagination(int currentPagination) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.currentPagination = currentPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getTotalPaginations() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn totalPaginations;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setTotalPaginations(int totalPagination) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.totalPaginations = totalPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getTotalElements() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn totalRecords;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setTotalElements(int totalElements) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.totalRecords = totalElements;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getSearchBeginCursor() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn searchBeginCursor;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setSearchBeginCursor(int searchBeginCursor) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.searchBeginCursor = searchBeginCursor;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getSearchEndCursor() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn searchEndCursor;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setSearchEndCursor(int searchEndCursor) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.searchEndCursor = searchEndCursor;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getPaginationSize() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn paginationSize;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setPaginationSize(int paginationSize) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.paginationSize = paginationSize;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getHiddenCurrentPagination() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn hiddenCurrentPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setHiddenCurrentPagination(int hiddenCurrentPagination) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.hiddenCurrentPagination = hiddenCurrentPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getHiddenTotalPaginations() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn hiddenTotalPaginations;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setHiddenTotalPaginations(int hiddenTotalPaginations) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.hiddenTotalPaginations = hiddenTotalPaginations;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getTotalRecords() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn totalRecords;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setTotalRecords(int totalRecords) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.totalRecords = totalRecords;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic String getInputCurrentPagination() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn inputCurrentPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setInputCurrentPagination(String inputCurrentPagination) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.inputCurrentPagination = inputCurrentPagination;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic List<String> getCombinedSelectConditions() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn selectedCompositeConditions;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setCombinedSelectConditions(List<String> combinedSelectConditions) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.selectedCompositeConditions = combinedSelectConditions;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic List<String> getCombinedConditions() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn inputCompositeConditions;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setCombinedConditions(List<String> combinedConditions) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.inputCompositeConditions = combinedConditions;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getQueryBoxNumber() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn queryBoxNumber;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setQueryBoxNumber(int queryBoxNumber) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.queryBoxNumber = queryBoxNumber;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic Set<Integer> getEventIds() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn eventIds;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setEventIds(Set<Integer> foodtypeIds) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.eventIds = foodtypeIds;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic int getFoodtypeId() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn foodtypeId;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setFoodtypeId(int foodtypeId) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.foodtypeId = foodtypeId;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic Map<Integer,String> getFoodTypeIdMap() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn foodTypeIdMap;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic void setFoodTypeIdMap(Map<Integer,String> foodMap) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.foodTypeIdMap = foodMap;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t@Override");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic String toString() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn \"CmiRestPagination [paginationSize=\" + paginationSize + \", beginPagination=\" + beginPagination + \", currentPagination=\" + currentPagination");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t+ \", totalPaginations=\" + totalPaginations + \", totalRecords=\" + totalRecords + \", searchBeginCursor=\"");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t+ searchBeginCursor + \", searchEndCursor=\" + searchEndCursor + \", hiddenCurrentPagination=\"");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t+ hiddenCurrentPagination + \", hiddenTotalPaginations=\" + hiddenTotalPaginations + \", inputCurrentPagination=\" + inputCurrentPagination");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t+ \", queryBoxNumber=\" + queryBoxNumber + \", eventIds=\" + eventIds + \", foodtypeId=\" + foodtypeId");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t+ \", selectedCompositeConditions=\" + selectedCompositeConditions + \", inputCompositeConditions=\"");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t\t\t+ inputCompositeConditions + \"]\";");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t// TODO　请杨宏宇确认　０２０年２月７");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//\t\tｒｅｓｔＰａｇｉｎａｔｉｏｎ中的ｔｏＳｔｒｉｎｇ方法，不知道是否有需要");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//\t\t return \"CmiRestPagination [name=\" + name + \", paginationSize=\" + paginationSize + \", beginPagination=\" + beginPagination + \", currentPagination=\"");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//         + currentPagination + \", totalPaginations=\" + totalPaginations + \", totalRecords=\" + totalRecords + \", attributeMap=\"");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("//         + attributeMap + \"]\";");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\tpublic String toRestString() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\t return \"{\\\"name\\\":\" + name + \", \\\"paginationSize\\\":\" + paginationSize + \", \\\"beginPagination\\\":\" + beginPagination + \", \\\"currentPagination\\\":\"");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("      + currentPagination + \", \\\"totalPaginations\\\":\" + totalPaginations + \", \\\"totalRecords\\\":\" + totalRecords + \", \\\"attributeMap\\\":\"");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("      + new Gson().toJson(attributeMap) + \"}\";");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("\tpublic String getName() {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\treturn name;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write(NL);         
        out.write("\tpublic void setName(String name) {");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t\tthis.name = name;");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t}");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("\t");  //$NON-NLS-1$        
        out.write(NL);         
        out.write("}");  //$NON-NLS-1$        
    }
}
